package com.jswdwsx.esign.entity

import com.jswdwsx.esign.cloud.enums.IdTypeEnum
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.hibernate.annotations.GenericGenerator
import org.hibernate.annotations.Parameter
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import javax.persistence.*

@Entity
@EntityListeners(AuditingEntityListener::class)
@DynamicInsert
@DynamicUpdate
@Table(name = "user")
data class UserPO(

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @GenericGenerator(name = "jpa-uuid", strategy = "uuid")
    var id: String? = null,

    @Column(name = "name")
    var name: String? = null,

    @Column(name = "account_id")
    var accountId: String,

    @Column(name = "id_type")
    @Enumerated(EnumType.STRING)
    var idType: IdTypeEnum? = null,

    @Column(name = "id_number")
    var idNumber: String? = null,

    @Column(name = "mobile")
    var mobile: String? = null,

    @Column(name = "email")
    var email: String? = null
)